Skip to content

Add support for the NEO cartridge format in romtool#152

Open
floitsch wants to merge 1 commit into
dciabrin:masterfrom
floitsch:romtool-neo-format
Open

Add support for the NEO cartridge format in romtool#152
floitsch wants to merge 1 commit into
dciabrin:masterfrom
floitsch:romtool-neo-format

Conversation

@floitsch

@floitsch floitsch commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

This adds a new cartridge output format to romtool: the NEO format, a single-file cartridge format originally designed for the NeoSD flashcart, and also used by the Geolith emulator and the MiSTer Neo Geo core. Geolith does not load MAME-style zip romsets, so this makes ngdevkit games directly runnable there.

Format

The file consists of a 4KiB header (magic NEO + version 1, region sizes, year/genre/screenshot/NGH metadata, game name and manufacturer), followed by the ROM data in P, S, M, V1, V2, C order:

  • P/S/M/V regions are the ROM files concatenated, padded with 0xff to 64KiB
  • the C region stores each (c1, c2) pair byte-interleaved (c1 on even bytes, c2 on odd), padded to 256KiB
  • all ADPCM samples go into V1 and V2 stays empty, matching ngdevkit's single ADPCM region

Usage

romtool -b cartridge -f neo -p rom.p1 -s rom.s1 -m rom.m1 -v rom.v1 -c rom.c1 rom.c2 \
        -n mygame -l "My Game" -y 2026 --publisher me \
        -x neo.genre=Shooter neo.ngh=041 neo.screenshot=0 -o mygame.neo

The -x neo.* extras are optional: genre defaults to Other, and NGH/screenshot default to 0, which is appropriate for homebrew (emulators only use the NGH id to apply per-game quirks for commercial titles).

Validation

The generated files are byte-identical to the ones produced by the reference converter (neosdconv), tested with one and two C-ROM pairs, including region sizes that exercise the padding. The existing mame/gngeo/zip code paths are unchanged.

Note: neosdconv swaps the two megabytes of a 2MiB P-ROM because commercial MAME dumps store the banked megabyte first. This is deliberately not replicated here, since ngdevkit build outputs are already in linear 68k address order, consistent with how the MAME hash backend loads them.

The NEO format is a single-file cartridge format originally designed
for the NeoSD flashcart, and also used by the Geolith emulator and
the MiSTer Neo Geo core. A cartridge is built with:

  romtool -b cartridge -f neo -o game.neo <roms...>

Game metadata (genre, NGH id, NeoSD screenshot id) can be passed as
extra options, e.g. -x neo.genre=Shooter neo.ngh=041.

The generated files are byte-identical to the ones produced by the
reference converter (neosdconv).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant